<template>
	<view class="">
		<view class="nav-box nav-box2">
			<view class="nav _df _jb _ac mb20">
				<view class="back">
					<image @click="back" src="@/static/img/common/topBack.png" alt="" />
				</view>
				<!-- <view class="title">{{title}}</view> -->
				<view class="right _df _jc _ac" v-if="isShowR" @click="save" hover-class="hover">
					<image src="@/static/img/index/gou.png" alt="" />
				</view>
			</view>
			<view class="title _df _jb _ac">
				<view class="">
					{{title}}
				</view>
				<view class="titleR" @click="titleFn">
					{{titleR}}
				</view>
			</view>
		</view>
		<view class="nav-box">
			<view class="nav _df _jb _ac mb20">
				<view class="back">
					<image @click="back" src="@/static/img/common/topBack.png" alt="" />
				</view>
				<!-- <view class="title">{{title}}</view> -->
				<view class="right _df _jc _ac" v-if="isShowR" @click="save" hover-class="hover">
					<image src="@/static/img/index/gou.png" alt="" />
				</view>
			</view>
			<view class="title _df _jb _ac">
				<view class="">
					{{title}}
				</view>
				<view class="titleR" @click="titleFn">
					{{titleR}}
				</view>
			</view>
		</view>
	</view>
	
</template>

<script>
	export default {
		name:"view-head",
		props: {
		  // 标题
		  Title: {
		    type: String,
		    default: '',
		  },titleR: {
		    type: String,
		    default: '',
		  },
		  isShowR:{
			  type:Boolean,
			  default: false,
		  }
		},
		data() {
			return {
				title:'',
			};
		},
		methods:{
			back(){
				// uni.navigateBack(-1)
				uni.navigateBack({
					delta:1
				})
			},
			save(){
				this.$emit('saveBack')
			},
			titleFn(){
				this.$emit('titleBack')
			},
		},
		mounted() {
			this.title = this.Title
		}
	}
</script>

<style lang="scss" scoped>
	.nav-box{
		padding: 100rpx 30rpx 0;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 33;
		background-color: #fff;
		
		.nav{
			// height: 80rpx;
		}
		.back{
			// position: absolute;
			// top: 50%;
			// left: 0;
			// transform: translateY(-50%);
			image{
				width: 40rpx;
				height: 40rpx;
			}
		}
		.right{
			width: 80rpx;
			height: 60rpx;
			background-color: #fff;
			border-radius: 6rpx;
			image{
				width: 37rpx;
				height: 27rpx;
			}
		}
		.hover{
			background-color: #F2F6FE;
		}
		.title-box{
			text-align: center;
			margin: 0 auto;
			
			.time{
				font-size: 28rpx;
				font-family: $uni-font-family-Medium;
				color: #000;
			}
		}
		.title{
			font-size: 60rpx;
			font-family: $uni-font-family-Bold;
			color: #000;
			padding: 0 10rpx;
		}.titleR{
			font-size: 30rpx;
			font-family: $uni-font-family-Bold;
			color: #000;
		}
		
		
	}
	.nav-box2{
		position: relative;
		margin-bottom: 60rpx;
	}
	
</style>